﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using KM.BUS;
using KM.ENT;

namespace KM.Areas.Admin.Controllers
{
    public class UsersController : Controller
    {
        //
        // GET: /Admin/Users/

        public ActionResult Login()
        {
            Session.RemoveAll();
            return View();
        }

        [HttpPost]
        [ValidateAntiForgeryToken]

        public ActionResult Login(entUsers entU)
        {

            busUsers busU = new busUsers();
            if (ModelState.IsValid)
            {
                if (busU.getLogin(ref entU))
                {

                    Session["Userid"] = entU.Id;
                    return RedirectToAction("index", "home");
                }
            }
            return View();
        }
        public ActionResult Edit(entUsers entU)
        {

            return View();
        }
    }
}
